package com.lili.collection.core.runner.result;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 *描述: 错误详情日志
 *@date: 2023/6/5  12:54
 *@author: lili
 */
@Data
@NoArgsConstructor
public class ErrorDetail implements Serializable {
    private static final long serialVersionUID = -7501726038276782388L;
    /**
     * 属性类型
     */
    private String propType;

    /**
     * 属性值
     */
    private Object propValue;

    /**
     * 错误明细消息
     */
    private String errorMessage;

    /**
     * 数据量大小
     */
    private int dataSize;

    public ErrorDetail(String propType, Object propValue, String errorMessage, int dataSize) {
        this.propType = propType;
        if(propValue!=null && (propValue instanceof String) && ((String) propValue).length()>1000){
            this.propValue = ((String)propValue).substring(0,1000);
        }else {
            this.propValue=propValue;
        }
        this.errorMessage = errorMessage;
        this.dataSize = dataSize;
    }
}